<template>
  <div class="pat_info">
    <div class="grid_tit">
      <div class="flex flex-row align-center justify-between pad-b-6 mar-t-10">
        <div class="mar-l-3 flex flex-row align-center">
          <span class="font-bold">申请单信息</span>
          <el-button class="mar-l-10 conditionSearchBtn" size="mini" v-permission="'YJYY10007003'" @click="appointResultSearch">预约情况查询</el-button>
        </div>
        <div class="ky-fr flex flex-row align-center">
          <el-tag
            v-if="rowCurr.emergency"
            size="mini"
            effect="dark"
            type="danger"
          >{{rowCurr.emergencylabel}}</el-tag>
          <div>
            <el-tag
              v-if="rowCurr.patientName"
              :title="rowCurr.emergencylabel"
              size="mini"
              effect="dark"
              :type="rowCurr.emergency > 0 ? 'danger':'warn'"
            >{{rowCurr.patientName}}</el-tag>
            <span>{{rowCurr.genderTxt}} {{rowCurr.patAgeTxt}}</span>
          </div>
        </div>
      </div>
    </div>
    <div class="pat_info_item mar-t-6">
      <AppInfoItem label="检查号" v-if="mipVisible == false" :txt="rowCurr.patientId" style="width: 50%"/>
      <AppInfoItem label="病人类型" style="width: 50%">
        <span>{{rowCurr && rowCurr.visit ? getSource('','',rowCurr.visit.patientSource) : getSource('','',rowCurr && rowCurr.patientSource)}}</span>
      </AppInfoItem>
      <AppInfoItem label="出生日期" :txt="rowCurr.birthDate" style="width: 50%"/>
      <AppInfoItem label="联系方式" :txt="rowCurr.patientPhone" style="width: 50%"><i class="el-icon-edit" @click="editPhone(rowCurr.patientPhone)" title="修改联系方式" style="cursor: pointer;"></i></AppInfoItem>
      <!-- 新增地址信息 -->
      <AppInfoItem label="地址" :txt="rowCurr.address" style="width: 50%;"/>
      <AppInfoItem label="优惠类型" :txt="rowCurr.feeType" style="width: 50%"/>
      <AppInfoItem label="申请医生" :txt="rowCurr.applyDoctor" style="width: 50%"/>
      <AppInfoItem label="申请科室" :txt="rowCurr.applyDepartment || ''" style="width: 50%"/>
      <AppInfoItem label="申请时间" :txt="rowCurr.applyDateTime" style="width: 50%"/>
      <AppInfoItem label="床号" :txt="rowCurr.bedNo" v-show="rowCurr.bedNo" style="width: 50%"/>
      <AppInfoItem label="检查目的" :txt="rowCurr.examPurpose" style="width: 50%"/>
      <AppInfoItem label="检查项目" :txt="rowCurr.examItemName" style="width: 50%"/>
      <AppInfoItem label="检查部位" :txt="rowCurr.examPart" style="width: 50%"/>
      <AppInfoItem label="金额" :txt="rowCurr.cost" style="width: 50%"/>
      <AppInfoItem label="优先级" txt="" style="width: 100%">
        <el-tag v-if="rowCurr.emergency > 0 && rowCurr.emergencylabel !='普通' && rowCurr.emergencylabel" size="mini" effect="dark" :type="rowCurr.emergency && rowCurr.emergencylabel !='普通' ? 'danger': ''">{{rowCurr.grade}}</el-tag>
        <span v-else>{{rowCurr.emergencylabel}}</span>
        <i class="el-icon-edit" v-if="isShowLevelEdit" @click="editLevel(rowCurr.emergencylabel)" title="修改优先级" style="cursor: pointer;"></i>
        <el-checkbox class="mar-l-20" v-permission="'YJYY10007001'" v-model="rowCurr.isJZ" @change="handleJZChange">急诊</el-checkbox>
        <el-checkbox class="mar-l-20" v-permission="'YJYY10007002'" v-model="rowCurr.isVIP" label="VIP" @change="handleVIPChange">VIP</el-checkbox>
      </AppInfoItem>
      <AppInfoItem label="保密级别" style="width: 50%" v-permission="'YJYY10008051'">
        <el-select size="mini" ref="examClass" v-model="rowCurr.privacyLevel" filterable style="width:120px;" @change="changePrivacyLevel" clearable>
          <el-option
            v-for="(item, index) in privacyLevelList"
            :key="index"
            :value="item.value"
            :label="item.label"
          ></el-option>
        </el-select>
      </AppInfoItem>
      <!-- PrivacyLevel -->
      <!-- <AppInfoItem label="临床诊断" :txt="rowCurr.clinicdiagnosis" style="width: 100%;" min-height="60px"/> -->
      <AppInfoItem label="主诉" :txt="rowCurr.chiefComplaint" style="width: 100%;" min-height="60px" v-if="isShowChiefComplaint"/>
      <AppInfoItem label="检查备注" :txt="rowCurr.remarkInfo" style="width: 100%" item-txt-color="#f00">
        <i class="el-icon-edit" @click="editRemarkInfo(rowCurr.remarkInfo)" title="修改优先级" style="cursor: pointer;color:#000" v-if="isSetRemarkInfo"></i>
      </AppInfoItem>
      <AppInfoItem label="电子病史" :txt="rowCurr.diseasesHistory" style="width: 100%;" min-height="60px"/>
      <AppInfoItem label="收费状态" :txt="rowCurr.feeStatus" style="width: 50%"/>
      <AppInfoItem label="申请单号" :txt="rowCurr.applyCode" style="width: 100%"/>
    </div>
    <!-- <div class="bottomBox">
      <el-button class="closeBtn" type="info" size="small" @click="handleClose">关闭</el-button>
    </div> -->
  </div>
</template>
<script>
import applyInfo from '@/mixin/applyInfo'
// import {
//   getItemList
// } from '@/api/api'
export default {
  mixins: [applyInfo],
  props: {
    mipVisible: {
      type: Boolean,
      default: true
    }
  },
  data() {
    return {
      isDev: process.env.NODE_ENV != 'production'
    }
  },
  mounted() {
    this.getPrivacyLevel()
  },
  methods: {
    appointResultSearch() {
      this.$emit('appointResultSearch')
    }
  }
}
</script>

<style lang="scss" scoped>
  .pat_info{
    padding: 0 10px 10px;
    .pat_info_item{
      display: flex;
      flex-wrap: wrap;
    }
  }
  .el-checkbox {
    margin-right: 0px !important;
  }
</style>
